# coding=utf-8
from BlueFoxTools.ToolsConfig import *
from BlueFoxTools.ScreenTools import ScreenTools
from BlueFoxTools.SpecialFunciton.BlueFoxRuckSackEngine import BlueFoxClientSystem, RucksackScreen


@ScreenTools.AutoRegister('myTestUi.main')
class TestUi(RucksackScreen):
    blueFoxClient = BlueFoxClientSystem if 0 else None
    screenTools = ScreenTools.GetTools('TestUi')

    def __init__(self, name_spase, ui_key, param):
        super(TestUi, self).__init__(
            name_spase, ui_key, param, ['/panel/inventory_panel/hotbar', '/panel/inventory_panel/inventory'],
            clientCompFactory.CreateItem(clientApi.GetLocalPlayerId()).GetPlayerAllItems(0, True)
        )

    def Create(self):
        super(TestUi, self).Create()
        self.screenTools.Binding(self)

    @screenTools.ButtonCallFuncBackBinder(ButtonTouchTypeEnum.TouchUp, '/panel/close')
    def Close(self, args):
        clientApi.PopScreen()
